ostadmin: Use g_spawn_check_exit_status()
authorColin Walters <walters@verbum.org>
Fri, 3 Aug 2012 12:49:22 +0000 (08:49 -0400)
committerColin Walters <walters@verbum.org>
Sun, 5 Aug 2012 20:39:57 +0000 (16:39 -0400)
Just code cleanup.

src/libostree/ostree-sysroot.c

index cd1d686187af718ff3bcf6f4ba63fafb984bfcf3..188e4beab0117fd551c3d1e6caeae3c175fda30e 100644 (file)
@@ -95,21 +95,8 @@ ostree_run_triggers_in_root (GFile                  *root,
                          NULL, NULL, NULL, NULL, &estatus, error))
         goto out;
 
-      if (WIFEXITED (estatus))
-        {
-          if (WEXITSTATUS (estatus) != 0)
-            {
-              g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
-                           "Trigger process exited with code %d", (int)WEXITSTATUS (estatus));
-              goto out;
-            }
-        }
-      else
-        {
-          g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
-                       "Trigger process failed due to signal");
-          goto out;
-        }
+      if (!g_spawn_check_exit_status (estatus, error))
+        goto out;
     }
 
   ret = TRUE;